package dyyx.util;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import javax.servlet.http.HttpServletRequest;

import org.apache.commons.lang3.StringUtils;

import com.alibaba.fastjson.JSON;

public abstract class WebActionUtil {
	
	public static String doEsClient(HttpServletRequest req) {
		String url = req.getParameter("url");
		String user = req.getParameter("username");
		String pwd = req.getParameter("userpwd");
		String method = req.getParameter("reqmethod");
		String requestBody = req.getParameter("request_body");
		
		if(StringUtils.isBlank(url)){
			return "url is blank";
		}
		url = url.trim();
		
		
		try {
			return EsClientUtils.doExecute(url, method, requestBody, null);
		} catch (Throwable e) {
			return e.toString();
		}

	}
	


}
